<?php
/**
 * 这是视图共享文件
 */
namespace App\Http\ViewComposers;

use App\Libs\CommonUtils;
use Illuminate\Http\Request;
use Illuminate\View\View;

class AdminComposer {
    private $data = null;//CommonUtils对象

    public function __construct(Request $request)
    {
        $this -> data = new CommonUtils($request);
    }

    public function compose(View $view)
    {
        $view -> with([
            'prole'=>$this -> data -> prole,
            'menu'=>$this -> data -> menu,
        ]);
    }
}